<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page language="java" import="java.util.*" pageEncoding="utf-8" %>
<%@include file="/commons/taglibs.jsp" %>
<!DOCTYPE html>
<html>
<fmt:bundle basename="res">
<head>
    <meta charset="utf-8">
    <title><fmt:message key='zhyyglhtxt'/></title>
    <jsp:include page="/WEB-INF/commons/commons-header.jsp" flush="true"/>
    <style>
        html {
            background: #fff;
        }
    </style>
</head>

<body>

<div class="layui-tab layui-tab-brief" lay-filter="docDemoTabBrief">
    <ul class="layui-tab-title">
        <li class="layui-this"><fmt:message key='sjjbxx'/></li>
        <li><fmt:message key='fbdsp'/></li>
        <li><fmt:message key='ddjl'/></li>
    </ul>
    <div class="layui-tab-content" style="height: 100%;">
<%--        商家基本信息--%>
        <div class="layui-tab-item layui-show">


            <div class="layui-container">
                <div class="layui-form" lay-filter="layuiadmin-app-form-list" id="layuiadmin-app-form-list" style="padding: 20px 30px 0 0;">
                    <form:form commandName="supplier" class="layui-form" id="serviceForm">

                        <fieldset class="layui-elem-field layui-field-title" style="margin-top: 20px;">
                            <legend><fmt:message key='zhxx'/></legend>
                        </fieldset>

                        <div class="layui-row layui-col-space30">

                            <div class="layui-col-md6">

                                <div class="layui-form-item">
                                    <label class="layui-form-label"><fmt:message key='zh'/></label>
                                    <div class="layui-form-mid layui-word-aux">
                                            ${supplier.username}
                                    </div>
                                </div>

                            </div>

                        </div>




                        <fieldset class="layui-elem-field layui-field-title" style="margin-top: 20px;">
                            <legend><fmt:message key='yhkxx'/></legend>
                        </fieldset>

                        <div class="layui-row layui-col-space30">

                            <div class="layui-col-md6">
                                <div class="layui-form-item">
                                    <label class="layui-form-label"><fmt:message key='khr'/></label>
                                    <div class="layui-form-mid layui-word-aux">
                                            ${supplier.bankAccountHolder}
                                    </div>
                                </div>
                                <div class="layui-form-item">
                                    <label class="layui-form-label"><fmt:message key='yhk'/></label>
                                    <div class="layui-form-mid layui-word-aux">
                                            ${supplier.bankCardNo}
                                    </div>
                                </div>
                                <div class="layui-form-item">
                                    <label class="layui-form-label"><fmt:message key='khh'/></label>
                                    <div class="layui-form-mid layui-word-aux">
                                            ${supplier.bankName}
                                    </div>
                                </div>

                            </div>

                            <div class="layui-col-md6">
                                <div class="layui-form-item">
                                    <label class="layui-form-label"><fmt:message key='ylsjh'/></label>
                                    <div class="layui-form-mid layui-word-aux">
                                            ${supplier.bankMobile}
                                    </div>
                                </div>
                                <div class="layui-form-item">
                                    <label class="layui-form-label"><fmt:message key='ssss'/></label>
                                    <div class="layui-form-mid layui-word-aux">
                                            ${supplier.bankProvince}${supplier.bankCity}
                                    </div>
                                </div>
                                <div class="layui-form-item">
                                    <label class="layui-form-label"><fmt:message key='khzh'/></label>
                                    <div class="layui-form-mid layui-word-aux">
                                            ${supplier.bankSubBranchName}
                                    </div>
                                </div>

                            </div>
                        </div>

                        <fieldset class="layui-elem-field layui-field-title" style="margin-top: 20px;">
                            <legend><fmt:message key='dpxx'/></legend>
                        </fieldset>

                        <div class="layui-form-item">
                            <label class="layui-form-label"><fmt:message key='jysplm'/></label>
                            <div class="layui-form-mid layui-word-aux">
                                <c:forEach items="${channels}" var="item">
                                    ${item.channel.name}、
                                </c:forEach>
                            </div>
                        </div>

                        <div class="layui-row layui-col-space30">

                            <div class="layui-col-md6">

                                <div class="layui-form-item">
                                    <label class="layui-form-label"><fmt:message key='dpmc'/></label>
                                    <div class="layui-form-mid layui-word-aux">
                                            ${supplier.shopName}
                                    </div>
                                </div>

                                <div class="layui-form-item">
                                    <label class="layui-form-label"><fmt:message key='lxrxm'/></label>
                                    <div class="layui-form-mid layui-word-aux">
                                            ${supplier.realName}
                                    </div>
                                </div>

                                <div class="layui-form-item">
                                    <label class="layui-form-label"><fmt:message key='yx'/></label>
                                    <div class="layui-form-mid layui-word-aux">
                                            ${supplier.email}
                                    </div>
                                </div>

                            </div>
                            <div class="layui-col-md6">

                                <div class="layui-form-item">
                                    <label class="layui-form-label"><fmt:message key='lxdh'/></label>
                                    <div class="layui-form-mid layui-word-aux">
                                            ${supplier.mobile}

                                    </div>
                                </div>

                                <div class="layui-form-item">
                                    <label class="layui-form-label"><fmt:message key='wx'/></label>
                                    <div class="layui-form-mid layui-word-aux">
                                            ${supplier.wechat}
                                    </div>
                                </div>

                                <div class="layui-form-item">
                                    <label class="layui-form-label">QQ</label>
                                    <div class="layui-form-mid layui-word-aux">
                                            ${supplier.qq}
                                    </div>
                                </div>

                            </div>
                        </div>

                        <div class="layui-form-item">
                            <label class="layui-form-label"><fmt:message key='sjztlx'/></label>
                            <div class="layui-form-mid layui-word-aux">
                                <c:choose>
                                    <c:when test="${supplier.mainType eq 1}"><fmt:message key='qy1'/></c:when>
                                    <c:when test="${supplier.mainType eq 2}"><fmt:message key='gth'/></c:when>
                                    <c:when test="${supplier.mainType eq 3}"><fmt:message key='gr'/></c:when>
                                </c:choose>
                            </div>
                        </div>

                        <c:choose>
                            <c:when test="${supplier.mainType eq 1}">
                                <div class="layui-row layui-col-space30">

                                    <div class="layui-col-md6">

                                        <div class="layui-form-item">
                                            <label class="layui-form-label"><fmt:message key='gsmc'/></label>
                                            <div class="layui-form-mid layui-word-aux">
                                                    ${supplier.merchantEnterpriseInfo.company}
                                            </div>
                                        </div>

                                        <div class="layui-form-item">
                                            <label class="layui-form-label"><fmt:message key='frxm'/></label>
                                            <div class="layui-form-mid layui-word-aux">
                                                    ${supplier.merchantEnterpriseInfo.legalPersonRealname}
                                            </div>
                                        </div>

                                        <div class="layui-form-item">
                                            <label class="layui-form-label"><fmt:message key='qy2'/></label>
                                            <div class="layui-form-mid layui-word-aux">
                                                    ${supplier.merchantEnterpriseInfo.province} ${supplier.merchantEnterpriseInfo.city} ${supplier.merchantEnterpriseInfo.area}
                                            </div>
                                        </div>

                                        <div class="layui-form-item">
                                            <label class="layui-form-label"><fmt:message key='frsfzzm'/></label>
                                            <div class="layui-form-mid layui-word-aux">
                                                <c:if test="${not empty supplier.merchantEnterpriseInfo.legalPersonIdCardPhoto}">
                                                    <img src="${store_domain}/uploads/${supplier.merchantEnterpriseInfo.legalPersonIdCardPhoto}" class="preview" style="width:120px;height:120px;margin-top:10px;">
                                                </c:if>
                                                <c:if test="${empty supplier.merchantEnterpriseInfo.legalPersonIdCardPhoto}">
                                                    <img src="${web_domain}/resources/images/default.jpeg" style="width:120px;height:120px;margin-top:10px;">
                                                </c:if>
                                            </div>
                                        </div>


                                        <div class="layui-form-item">
                                            <label class="layui-form-label"><fmt:message key='gsyyzz'/></label>
                                            <div class="layui-form-mid layui-word-aux">
                                                <c:if test="${not empty supplier.merchantEnterpriseInfo.businessLicensePhoto}">
                                                    <img src="${store_domain}/uploads/${supplier.merchantEnterpriseInfo.businessLicensePhoto}" class="preview" style="width:120px;height:120px;margin-top:10px;">
                                                </c:if>
                                                <c:if test="${empty supplier.merchantEnterpriseInfo.businessLicensePhoto}">
                                                    <img src="${web_domain}/resources/images/default.jpeg" style="width:120px;height:120px;margin-top:10px;">
                                                </c:if>
                                            </div>
                                        </div>

                                    </div>
                                    <div class="layui-col-md6">

                                        <div class="layui-form-item">
                                            <label class="layui-form-label"><fmt:message key='yyzzhm'/></label>
                                            <div class="layui-form-mid layui-word-aux">
                                                    ${supplier.merchantEnterpriseInfo.businessLicenseNo}
                                            </div>
                                        </div>

                                        <div class="layui-form-item">
                                            <label class="layui-form-label"><fmt:message key='frsfz'/></label>
                                            <div class="layui-form-mid layui-word-aux">
                                                    ${supplier.merchantEnterpriseInfo.legalPersonIdCardNo}
                                            </div>
                                        </div>

                                        <div class="layui-form-item">
                                            <label class="layui-form-label"><fmt:message key='dz'/></label>
                                            <div class="layui-form-mid layui-word-aux">
                                                    ${supplier.merchantEnterpriseInfo.address}
                                            </div>
                                        </div>

                                        <div class="layui-form-item">
                                            <label class="layui-form-label"><fmt:message key='frsfzfm'/></label>
                                            <div class="layui-form-mid layui-word-aux">
                                                <c:if test="${not empty supplier.merchantEnterpriseInfo.legalPersonIdCardPhotoBack}">
                                                    <img src="${store_domain}/uploads/${supplier.merchantEnterpriseInfo.legalPersonIdCardPhotoBack}" class="preview" style="width:120px;height:120px;margin-top:10px;">
                                                </c:if>
                                                <c:if test="${empty supplier.merchantEnterpriseInfo.legalPersonIdCardPhotoBack}">
                                                    <img src="${web_domain}/resources/images/default.jpeg" style="width:120px;height:120px;margin-top:10px;">
                                                </c:if>
                                            </div>
                                        </div>


                                    </div>
                                </div>
                            </c:when>
                            <c:when test="${supplier.mainType eq 2}">
                                <div class="layui-row layui-col-space30">

                                    <div class="layui-col-md6">

                                        <div class="layui-form-item">
                                            <label class="layui-form-label"><fmt:message key='xm'/></label>
                                            <div class="layui-form-mid layui-word-aux">
                                                    ${supplier.merchantIndividualInfo.legalPersonRealname}
                                            </div>
                                        </div>

                                        <div class="layui-form-item">
                                            <label class="layui-form-label"><fmt:message key='ssdq'/></label>
                                            <div class="layui-form-mid layui-word-aux">
                                                    ${supplier.merchantIndividualInfo.province} ${supplier.merchantIndividualInfo.city} ${supplier.merchantIndividualInfo.area}
                                            </div>
                                        </div>

                                        <div class="layui-form-item">
                                            <label class="layui-form-label"><fmt:message key='yyzzhm'/></label>
                                            <div class="layui-form-mid layui-word-aux">
                                                    ${supplier.merchantIndividualInfo.businessLicenseNo}
                                            </div>
                                        </div>

                                        <div class="layui-form-item">
                                            <label class="layui-form-label"><fmt:message key='sfzzm'/></label>
                                            <div class="layui-form-mid layui-word-aux">
                                                <c:if test="${not empty supplier.merchantIndividualInfo.idCardPhoto}">
                                                    <img src="${store_domain}/uploads/${supplier.merchantIndividualInfo.idCardPhoto}" class="preview" style="width:120px;height:120px;margin-top:10px;">
                                                </c:if>
                                                <c:if test="${empty supplier.merchantIndividualInfo.idCardPhoto}">
                                                    <img src="${web_domain}/resources/images/default.jpeg" style="width:120px;height:120px;margin-top:10px;">
                                                </c:if>
                                            </div>
                                        </div>

                                        <div class="layui-form-item">
                                            <label class="layui-form-label"><fmt:message key='yyzz'/></label>
                                            <div class="layui-form-mid layui-word-aux">
                                                <c:if test="${not empty supplier.merchantIndividualInfo.businessLicensePhoto}">
                                                    <img src="${store_domain}/uploads/${supplier.merchantIndividualInfo.businessLicensePhoto}" class="preview" style="width:120px;height:120px;margin-top:10px;">
                                                </c:if>
                                                <c:if test="${empty supplier.merchantIndividualInfo.businessLicensePhoto}">
                                                    <img src="${web_domain}/resources/images/default.jpeg" style="width:120px;height:120px;margin-top:10px;">
                                                </c:if>
                                            </div>
                                        </div>

                                    </div>
                                    <div class="layui-col-md6">

                                        <div class="layui-form-item">
                                            <label class="layui-form-label"><fmt:message key='sfz'/></label>
                                            <div class="layui-form-mid layui-word-aux">
                                                    ${supplier.merchantIndividualInfo.idCardNo}
                                            </div>
                                        </div>

                                        <div class="layui-form-item">
                                            <label class="layui-form-label"><fmt:message key='dz'/></label>
                                            <div class="layui-form-mid layui-word-aux">
                                                    ${supplier.merchantIndividualInfo.address}
                                            </div>
                                        </div>

                                        <div class="layui-form-item">
                                            <label class="layui-form-label"><fmt:message key='sfzfm'/></label>
                                            <div class="layui-form-mid layui-word-aux">
                                                <c:if test="${not empty supplier.merchantIndividualInfo.idCardPhotoBack}">
                                                    <img src="${store_domain}/uploads/${supplier.merchantIndividualInfo.idCardPhotoBack}" class="preview" style="width:120px;height:120px;margin-top:10px;">
                                                </c:if>
                                                <c:if test="${empty supplier.merchantIndividualInfo.idCardPhotoBack}">
                                                    <img src="${web_domain}/resources/images/default.jpeg" style="width:120px;height:120px;margin-top:10px;">
                                                </c:if>
                                            </div>
                                        </div>

                                    </div>
                                </div>
                            </c:when>
                            <c:when test="${supplier.mainType eq 3}">

                                <div class="layui-row layui-col-space30">

                                    <div class="layui-col-md6">

                                        <div class="layui-form-item">
                                            <label class="layui-form-label"><fmt:message key='xm'/></label>
                                            <div class="layui-form-mid layui-word-aux">
                                                    ${supplier.merchantPersonalInfo.legalPersonRealname}
                                            </div>
                                        </div>

                                        <div class="layui-form-item">
                                            <label class="layui-form-label"><fmt:message key='ssdq'/></label>
                                            <div class="layui-form-mid layui-word-aux">
                                                    ${supplier.merchantPersonalInfo.province} ${supplier.merchantPersonalInfo.city} ${supplier.merchantPersonalInfo.area}
                                            </div>
                                        </div>

                                        <div class="layui-form-item">
                                            <label class="layui-form-label"><fmt:message key='sfzzm'/></label>
                                            <div class="layui-form-mid layui-word-aux">
                                                <c:if test="${not empty supplier.merchantPersonalInfo.legalPersonIdCardPhoto}">
                                                    <img src="${store_domain}/uploads/${supplier.merchantPersonalInfo.legalPersonIdCardPhoto}" class="preview" style="width:120px;height:120px;margin-top:10px;">
                                                </c:if>
                                                <c:if test="${empty supplier.merchantPersonalInfo.legalPersonIdCardPhoto}">
                                                    <img src="${web_domain}/resources/images/default.jpeg" style="width:120px;height:120px;margin-top:10px;">
                                                </c:if>
                                            </div>
                                        </div>

                                    </div>
                                    <div class="layui-col-md6">

                                        <div class="layui-form-item">
                                            <label class="layui-form-label"><fmt:message key='sfzhm'/></label>
                                            <div class="layui-form-mid layui-word-aux">
                                                    ${supplier.merchantPersonalInfo.idCardNo}
                                            </div>
                                        </div>

                                        <div class="layui-form-item">
                                            <label class="layui-form-label"><fmt:message key='dz'/></label>
                                            <div class="layui-form-mid layui-word-aux">
                                                    ${supplier.merchantPersonalInfo.address}
                                            </div>
                                        </div>

                                        <div class="layui-form-item">
                                            <label class="layui-form-label"><fmt:message key='sfzfm'/></label>
                                            <div class="layui-form-mid layui-word-aux">
                                                <c:if test="${not empty supplier.merchantPersonalInfo.legalPersonIdCardPhotoBack}">
                                                    <img src="${store_domain}/uploads/${supplier.merchantPersonalInfo.legalPersonIdCardPhotoBack}" class="preview" style="width:120px;height:120px;margin-top:10px;">
                                                </c:if>
                                                <c:if test="${empty supplier.merchantPersonalInfo.legalPersonIdCardPhotoBack}">
                                                    <img src="${web_domain}/resources/images/default.jpeg" style="width:120px;height:120px;margin-top:10px;">
                                                </c:if>
                                            </div>
                                        </div>

                                    </div>
                                </div>

                            </c:when>
                        </c:choose>


                    </form:form>
                </div>
            </div>
        </div>

<%--        发布的商品--%>
        <div class="layui-tab-item" style="height: 800px;">
            <iframe src="${web_domain}/mall/goods/list?merchant.id=${supplier.id}" style="width:100%;height: 100%;" frameborder="0"></iframe>
        </div>

<%--    订单记录--%>
        <div class="layui-tab-item" style="height: 800px;">
            <iframe src="${web_domain}/mall/order/list?merchant.id=${supplier.id}" style="width:100%;height: 100%;" frameborder="0"></iframe>
        </div>

    </div>
</div>

<link rel="stylesheet" href="${web_domain}/resources/plugins/ztree/css/zTreeStyle/zTreeStyle.css" type="text/css">
<script type="text/javascript" src="${web_domain}/resources/plugins/ztree/js/jquery.ztree.core.js"></script>
<script type="text/javascript" src="${web_domain}/resources/plugins/ztree/js/jquery.ztree.excheck.js"></script>
<script type="text/javascript" src="${web_domain}/resources/plugins/ztree/js/jquery.ztree.exedit.js"></script>
<script>

    function iframeLoad() {
        document.getElementById("iframe").height = 0;
        document.getElementById("iframe").height = document.getElementById("iframe").contentWindow.document.body.scrollHeight;
    }

    var setting = {
        view: {
//            addHoverDom: addHoverDom,
//            removeHoverDom: removeHoverDom,
            selectedMulti: false
        },
        data: {
            simpleData: {
                enable: true
            },
            key: {
                id: "id",
                name: "title",
                open: "spread"
            }
        }
//        callback: {
//            beforeClick: zTreeOnClick
//        }
    };

    $(function () {

        iframeLoad();
        $(document).ready(function () {
            var treeObj = $.fn.zTree.init($("#serviceTree"), setting, ${servicess});
            treeObj.expandAll(true);
        });
    });
</script>
</body>
</fmt:bundle>
</html>